#ifndef BOOSTING_MANAGER_H__CMU_
#define BOOSTING_MANAGER_H__CMU_

#include "data_structure.h"

#include <fstream>
#include <vector>
using namespace std;

class base_classifier;
class boosting_algorithm;

class boosting_manager {
	double * alpha;
	base_classifier ** classifiers;
	boosting_algorithm * a;
	int n_layer;
	int actual_layer;

public:
	void train_initialize(int layer, string algorithm_type, string base_type);
	void train(boosting_problem & prob, int argc, char ** argv);
	double test(boosting_node * x);
	void batch_test(boosting_node * x, vector<double> & results);
	void load(string filename);
	void dump(string filename);
	string get_filename(string filename, int lyr);
	~boosting_manager();
protected :
	void preprocess(boosting_problem & prob);
	void train_prediction_full(base_classifier * c, double * p, boosting_problem & prob);
	void train_prediction_partial(base_classifier * c, double * p, double * d, boosting_problem & prob);
};

#endif